package routers

import (
	"chat-room/http/controllers"
	"github.com/gin-gonic/gin"
)

func InitRoutersApis(api *gin.RouterGroup) {

	room := controllers.Room{}
	user := controllers.User{}

	//  ===  开始路由注册 start====
	roomGroup := api.Group("room")
	{
		// 页面
		roomGroup.GET("room-page", room.RoomIndex)
		roomGroup.GET("room-detail-index/:name/:id/:token", room.RoomDetailIndex)

		// ajax 接口
		roomGroup.POST("room-list", room.GetRoomList)
		roomGroup.POST("room-add", room.RoomAdd)
		roomGroup.GET("room-info", room.RoomInfo)

	}

	userGroup := api.Group("user")
	{
		// ajax 接口
		userGroup.POST("user-add", user.UserAdd)

	}
}
